package com.minelx.scriptbuilder.script.attribute.value;

public class BoolValue implements IAttribute {
	public static final String TRUE = "true";

	public static final String FALSE = "false";

	private final boolean value;

	public BoolValue(boolean value) {
		this.value = value;
	}

	@Override
	public String asString() {
		return String.valueOf(value);
	}

	public static BoolValue ofTrue() {
		return new BoolValue(true);
	}

	public static BoolValue ofFalse() {
		return new BoolValue(false);
	}

	public static BoolValue of(String valueAsText) {
		return valueAsText.equals(TRUE) ? ofTrue() : ofFalse();
	}
}
